package com.kizuki.base;

import org.junit.Test;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Random;
import java.util.Scanner;

public class TestBase {

    @Test
    public void test() {
        Integer integer = Integer.valueOf("111001010", 2);
        String s = Integer.toBinaryString(integer);
        System.out.println(integer + " " + s);

        String str = "a,b,c,,";
        String[] ary = str.split(",");
        // 预期大于 3，结果是 3
        System.out.println(ary.length);
        for (String s1 : ary) {
            System.out.println(s1);
        }

        Random random = new Random();
        System.out.println(random.nextInt(56));
        // 不要用
        System.out.println((int) (Math.random() * 56));
    }


    public static void main(String[] args) {
        inputWay2();
    }

    private static void inputWay1() {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            String next = scanner.next();
            System.out.println("input = " + next);
        }
    }

    /**
     * 先输入一个数量
     * 第二次输入这么多数量的数字相加
     */
    private static void inputWay2() {
        try (BufferedReader bf = new BufferedReader(new InputStreamReader(System.in))){
            int n = Integer.parseInt(bf.readLine());
            int res = 0;
            String[] str = bf.readLine().split(" ");
            bf.close();
            for(int i=0; i<n; i++){
                res ^= Integer.parseInt(str[i]);
            }
            System.out.println(res);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {

        }
    }
    
    @Test
    public void testStatic(){
        System.out.println(A.num);
    }

}


class A {

    static {
        num = 100;
        System.out.println(A.num);
        //System.out.println(num); // 静态代码块对于定义在它之后的静态变量，可以赋值，但是不能访问.
    }

    static int num = 300;
}

